﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ProjectWebNhac.DAO;
using System.Data;
using ProjectWebNhac.DTO;
namespace ProjectWebNhac.BUS
{
    public class BinhLuanVideoBus
    {
        public BinhLuanVideoBus() { }
        Dataprovider dao = new Dataprovider();
        
        public DataTable LayBinhLuanTheoMaVideo(int MaVideo)
        {
            return dao.LayDuLieuThamSo("sp_User_LayBinhLuanVideoTheoMaVideo",
           CommandType.StoredProcedure, new object[] { "@MaVideo", MaVideo });
        }

        public DataTable LayChiTietBinhLuan(int MaBinhLuan)
        {
            return dao.LayDuLieuThamSo("sp_Admin_LayBinhLuanVideoTheoMaBinhLuan",
           CommandType.StoredProcedure, new object[] { "@MaBinhLuan", MaBinhLuan });
        }

        public bool ThemBinhLuanVideo(BinhLuanVideoDTO objBinhLuan)
        {
            return dao.XuLySuKien("sp_User_ThemBinhLuanVideo",
                CommandType.StoredProcedure,
                new object[] { "@taikhoan",objBinhLuan.TaiKhoan,
                "@MaVideo",objBinhLuan.MaVideo,"@Noidung",
                objBinhLuan.LoiBinh});
        }

        public DataTable LayBinhLuanVideo()
        {
            return dao.LayDuLieuThamSo("sp_User_LayBinhLuanVideo",
           CommandType.StoredProcedure);
        }

        public bool XoaBinhLuan(int MaBinhLuan)
        {
            return dao.XuLySuKien("sp_Admin_XoaBinhLuanVideo",
                CommandType.StoredProcedure,
                new object[] { "@MaBinhLuan", MaBinhLuan });
        }

    }
}